package com.itclj.common.util;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 线程池工具类
 * 
 * @author lujun.chen
 * @version 2016年11月17日
 * @since JDK1.8
 */
public class ThreadPoolUtil {

	private static ThreadPoolUtil threadPoolUtils;
	private static ExecutorService fixedThreadPool;

	/**
	 * 实例化
	 */
	public static ThreadPoolUtil getInstance() {
		if (null == threadPoolUtils) {
			synchronized (ThreadPoolUtil.class) {
				if (null == threadPoolUtils) {
					threadPoolUtils = new ThreadPoolUtil();
					fixedThreadPool = Executors.newFixedThreadPool(30);
				}
			}
		}
		return threadPoolUtils;
	}

	public ExecutorService getFixedThreadPool() {
		return fixedThreadPool;
	}

}
